Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document ansible_group_priority #28777

Merged
merged 2 commits into from
Sep 7, 2017
Merged

Conversation

bcoca
Copy link
Member

@bcoca bcoca commented Aug 29, 2017

SUMMARY

documenting new feature
fixes #28769

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

inventory

ANSIBLE VERSION
2.4

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 docs_pull_request needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 29, 2017
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Aug 29, 2017
@ansibot
Copy link
Contributor

ansibot commented Sep 6, 2017

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 6, 2017
@bcoca bcoca modified the milestone: 2.4.0 Sep 6, 2017
Copy link
Contributor

@dharmabumstead dharmabumstead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with copy edits. Thanks @bcoca!

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 7, 2017
@bcoca bcoca merged commit 48da059 into ansible:devel Sep 7, 2017
@bcoca bcoca deleted the group_priority_docs branch September 7, 2017 03:36
.. _behavioral_parameters:

List of Behavioral Inventory Parameters
+++++++++++++++++++++++++++++++++++++++

As alluded to above, setting the following variables controls how ansible interacts with remote hosts.
As described above, setting the following variables control how Ansible interacts with remote hosts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting [these] controls = setting the following variables controls
or
the following variables control (drop "setting")

@@ -867,6 +867,8 @@ Basically, anything that goes into "role defaults" (the defaults folder inside t
If multiple groups have the same variable, the last one loaded wins.
If you define a variable twice in a play's vars: section, the 2nd one wins.
.. note:: the previous describes the default config `hash_behavior=replace`, switch to 'merge' to only partially overwrite.
.. note:: Group loading follows parent/child relationships. Groups of the same 'patent/child' level are then merged following alphabetical order.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/patent/parent/

prasadkatti pushed a commit to prasadkatti/ansible that referenced this pull request Oct 1, 2017
* document ansible_group_priority

* Copy edit pass
@kaistian
Copy link

kaistian commented Oct 9, 2017

This PR is missing from stable 2.4 branch and therefore it's missing from docs.ansible.com, could it be merge into stable please?

@termlen0
Copy link
Contributor

Has this been tested by setting group_variable_priority inside a group_vars file as well? I might be doing something wrong, but the following does not work:

test_var: 20
ansible_group_priority: 1

Whereas, setting this within the inventory file as:

group1:
  hosts:
    device1
  vars:
    test_var: higher
    ansible_group_priority: 10

group2:
  hosts:
    device1
  vars:
    test_var: lower

Works as expected.

@gilesw
Copy link

gilesw commented Jan 2, 2018

@termlen0 @bcoca I've found the same thing too. I was trying to set the variable using in an ini format inventory.

@hanej
Copy link

hanej commented Feb 10, 2018

The documentation doesn't show you how to use this feature. Where does this go? Can I use this in group_vars or in the inventory file? Are there examples that show how this works?

@ansibot ansibot added docs This issue/PR relates to or includes documentation. and removed docs_pull_request labels Mar 4, 2018
@frntn
Copy link
Contributor

frntn commented Mar 6, 2018

@hanej I have found this https://github.com/ansible/ansible/blob/76ff3e9efc0a74799bc2962508fdfcc8c2a920b6/docs/docsite/rst/user_guide/intro_inventory.rst#how-variables-are-merged

But not sure how to make use it in a ini format inventory...

cognifloyd added a commit to cognifloyd/ansible that referenced this pull request Jun 6, 2018
bcoca pushed a commit that referenced this pull request Jun 6, 2018
bcoca pushed a commit to bcoca/ansible that referenced this pull request Jun 6, 2018
bcoca pushed a commit to bcoca/ansible that referenced this pull request Jun 6, 2018
mattclay pushed a commit that referenced this pull request Jun 7, 2018
The docs committed in #28777 were inconsistent.
This clarifies that the default `ansible_group_priority` is `1`.[1][2]

[1] https://github.com/ansible/ansible/blob/153c9bd/lib/ansible/inventory/group.py#L40
[2] https://github.com/ansible/ansible/blob/153c9bd/lib/ansible/cli/inventory.py#L236

(cherry picked from commit 4fa2fb9)
nitzmahone pushed a commit that referenced this pull request Jun 8, 2018
jacum pushed a commit to jacum/ansible that referenced this pull request Jun 26, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 docs This issue/PR relates to or includes documentation. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add docs re ansible_group_priority
9 participants